package mce.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("mce-account")
public class LoginController {
	@RequestMapping(method = RequestMethod.POST)
    public ModelAndView processPage(@RequestParam("email") final String email, @RequestParam("password") final String password,
            final HttpServletRequest request,
            final HttpServletResponse response) {
    	if(email.equals("ElementTester@Nidec-MCE.com")&&password.equals("init1234")){
    		return new ModelAndView("Account");
    	}else{
    		return new ModelAndView("Login");
    	}
    }
	@RequestMapping
    public String  account() {
    	return "Account";
    }
}
